﻿@model List<VietPublisher.BaseProject.Models.ListBook>

<script type="text/javascript" charset="utf-8">
    var oTable;
    $(document).ready(function () {
        $('#example').dataTable({
            "sScrollY": "200px",
            "bPaginate": true
            // "bSort": false
            //"bFilter": false //search textbox is disable

        });



        /* Add a click handler to the rows - this could be used as a callback */
        $("#example tbody tr").click(function (e) {

            var data = oTable.fnGetData(this);
            alert("BookID : " + data[3]); //id of TR
            //alert(oTable);
            if ($(this).hasClass('row_selected')) {
                $(this).removeClass('row_selected');
            }
            else {
                oTable.$('tr.row_selected').removeClass('row_selected');

                $(this).addClass('row_selected');
            }
        });

    
        /* Init the table */
        oTable = $('#example').dataTable();
    });
    	

</script>
<table  id="example"   class="display"  width="100%">
    <thead>
        <tr class="">
            <th>
                Book Title
            </th>
            <th>
                Picture
            </th>
            <th>
                Price
            </th>
            <th style="display:none"></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var book in Model)
        {
            <tr>
                <td>@book.BookTitle
                
                </td>
                <td>@book.PictureID
                </td>
                <td>@book.PriceCurrent
                </td>
                <td style="display:none">@book.BookID</td>
            </tr>
        }
    </tbody>
</table>





<h1>Editor</h1>

<textarea rows="5" cols="200" id="txtDescription"></textarea>


<script type="text/javascript" language="javascript">
    CKEDITOR.replace('txtDescription');
				</script>  
